package com.alks.yn_zs.controller;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.page.PageParam;
import com.alks.entity.data.page.PageRecord;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.yn_zs.data.vo.FinishStoreVO;
import com.alks.yn_zs.data.vo.InOutStatisticVO;
import com.alks.yn_zs.service.IFinishStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * @author: chen
 * @date: 2024/11/22
 * @description: 成品仓储看板
 */
@Slf4j
@RestController
@ApiRestController("/show/finishStore")
@Api(value = "成品仓储看板", tags = "成品仓储看板")
public class FinishStoreShowController {

    @Resource
    private IFinishStoreService finishStoreService;

    @WebLogger
    @GetMapping("/pageDetail")
    @ApiOperation(value = "库存明细", tags = "成品仓储看板")
    public ResponseInfo pageDetail(PageParam pageParam) {
        PageRecord<FinishStoreVO> record = finishStoreService.pageDetail(pageParam);
        return ResponseInfo.ok(record);
    }

    @WebLogger
    @GetMapping("/inOutStatistic")
    @ApiOperation(value = "出入库统计", tags = "成品仓储看板")
    public ResponseInfo<InOutStatisticVO> inOutStatistic(@RequestParam(required = false) String time) {
        return ResponseInfo.ok(finishStoreService.inOutStatistic(time));
    }
}
